package com.itgungnir.diyshuo.activity.listview_activity;

import android.app.Activity;
import android.content.Context;
import android.widget.TextView;

import com.handmark.pulltorefresh.library.PullToRefreshListView;

import java.util.Map;

/**
 * ListViewActivity中相当于MVP中Presenter层的类
 */
public class ListViewPresenter implements ListViewContract.Presenter {
    private ListViewContract.Model model;
    private ListViewContract.View view;

    public ListViewPresenter(ListViewContract.View view) {
        this.view = view;
        this.model = new ListViewModel();
    }

    @Override
    public void setTextToTitle(TextView tv, String text) {
        model.setTextToTitle(tv, text);
    }

    @Override
    public void setContentToListView(Context context, PullToRefreshListView lv, Map<String, String> params) {
        model.setContentToListView(context, lv, params);
    }

    @Override
    public void onBackClickListener(Activity activity) {
        model.onBackClickListener(activity);
    }

    @Override
    public void onListViewItemClickListener() {
        model.onListViewItemClickListener();
    }

    @Override
    public void onListViewPullDownListener() {
    }

    @Override
    public void onListViewPullUpListener() {
    }
}